﻿using VisualWip.Core;
using VisualWip.Core.Columns;
using VisualWip.Core.Interfaces;

namespace VisualWip.PresentationModel.Line
{
    public class LineColumnSettingsViewModel : SettingsViewModelBase<LineColumn>
    {
        private readonly LineColumn _column;

        public LineColumnSettingsViewModel(Application application, LineColumn column, IColumnTypeProvider columnTypeProvider)
            : base(application, column, columnTypeProvider)
        {
            _column = column;
        }

        public int Thickness
        {
            get { return _column.Thickness; }
            set
            {
                if (_column.Thickness != value)
                {
                    _column.Thickness = value;
                    OnPropertyChanged(this, () => Thickness);
                }
            }
        }

        public bool IsHorizontal
        {
            get { return _column.IsHorizontal; }
            set
            {
                if (_column.IsHorizontal != value)
                {
                    _column.IsHorizontal = value;
                    OnPropertyChanged(this, () => IsHorizontal);
                }
            }
        }

        public string Color
        {
            get { return _column.Color; }
            set
            {
                if (_column.Color != value)
                {
                    _column.Color = value;
                    OnPropertyChanged(this, () => Color);
                }
            }
        }

        public override string SettingsWindowName
        {
            get { return "Line column settings"; }
        }

    }
}